package com.sxj.corejava.code07_面向对象.继承;

/**
 * @author 石小俊
 * @date 2025年01月07日
 */
public class Person {

    private String name;
    private int age;
    private String gender;

    public void show() {
        System.out.println("name:" + name + ",age:" + age + ",gender:" + gender);
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public String getGender() {
        return gender;
    }

    public void setGender(String gender) {
        this.gender = gender;
    }
}

class Man extends Person {
    private double salary;

    public void work() {
        System.out.println("男人需要工作养家,工资:" + salary);
    }

    public double getSalary() {
        return salary;
    }

    public void setSalary(double salary) {
        this.salary = salary;
    }
}

class WoMan extends Person {
    private int appearance;

    public void shopping() {
        System.out.println("女人负责貌美如花,喜欢逛街购物,颜值:" + appearance);
    }

    public int getAppearance() {
        return appearance;
    }

    public void setAppearance(int appearance) {
        this.appearance = appearance;
    }
}

// Java只支持单继承,可以间接的实现多继承
class SomeClass extends C {

}

class A {
    private String name;

}

class B extends A {
    private int age;
}

class C extends B {
    private String gender;
}